package mvc.selix;

import mvc.CurveModelManager;

import org.geom.curve.Curve;
import org.geom.curve.ICurve;

public class SelixPanelController{

	protected SelixModel model;
	protected CurveModelManager manager;

	public SelixPanelController(SelixModel model) {
		this.model = model;
		this.manager = CurveModelManager.getInstance();
	}
	

	public void setK(float t, boolean increment) {
		model.setK(t, increment);
		model.notifyAllViews();
	}

	public void setR(float t, boolean increment) {
		model.setR(t, increment);
		model.notifyAllViews();
	}

	public void setTrunk(ICurve trunk) {
		model.setTrunk(trunk);
		model.notifyAllViews();
	}

	public void setU(float t, boolean increment) {
		model.setU(t, increment);
		model.notifyAllViews();
	}

	
	public void setTrunkVisibility(boolean n) {
		SelixView3D.trunk_visibility = n;
		model.notifyAllViews();
	}

	public void setSampling(float n, boolean increment) {
		Curve.setLenght(n, increment);
		model.notifyAllViews();
		manager.getCurrentTrunkModel().notifyAllViews();
		manager.setAllDirty();
	}
	
}
